<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/commons/taglibs.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <title>新建用户</title>
  </head>
  <body class="container">
 	<form class="form-horizontal" role="form" action="${ctx}/admin/user/save"　method="post" id="form">
	  <div class="form-group  form-inline">
	    <label class="col-md-4 control-label">账号：</label>
	    <div class="col-md-4">
	    <input type="hidden" value="${bean.id}" name="id"/>
	      <input type="text" class="form-control" name="userName" value="${bean.userName}"
	      <c:if test="${bean.id!=null}">disabled</c:if>
	       datatype="s3-12" placeholder="请输入用户账号"/>
	    </div>
	  </div>
	  <div class="form-group  form-inline">
	    <label class="col-md-4 control-label">角色：</label>
	    <div class="col-md-4">
			<c:forEach items="${roles}" var="bean">
				 <label class="checkbox-inline">
	              <input type="checkbox" class="checkbox"
	              <c:if test="${fn:contains(ownRole,bean.id)}">checked="checked"</c:if>
	               name="roleIds" value="${bean.id}"> ${bean.roleName}
	            </label>
			</c:forEach>
	    </div>
	  </div>
	  <div class="form-group form-inline">
	    <label class="col-md-4 control-label"></label>
	    <div class="col-md-4">
	       <a class="help-block">重置密码</a>
	    </div>
	  </div>
	  <div class="form-group">
	   	<div class="col-md-8 text-right">
	  		<input type="submit" class="btn btn-primary" value="保存"></input>
	  	</div>
	  </div>
	</form>
	<script type="text/javascript">
	$(function(){
		$("#form").Validform({
			tiptype:4
			})
		});
	</script>
  </body>
</html>
